﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._08_桥接模式
{

    /// <summary>
    /// 海运集装箱
    /// </summary>
    public class OceanShipping : ShippingMethod
    {
        private string _waybillNumber;

        public OceanShipping(ILogisticsCompany company) : base(company) { }
      

        public override void CompleteShipping()
        {
            Console.WriteLine($"海运完成：港口卸货，结算费用 {_logisticsCompany.CalculateFreight(5000, 50):C}");
        }

        public override void ExecuteShipping()
        {
            Console.WriteLine($"开始海运运输：{_logisticsCompany.GetCompanyName()} 运单号：{_waybillNumber}");
        }

        public override void PrepareShipment()
        {
            Console.WriteLine("准备海运货物：集装箱装柜，报关手续");
            _waybillNumber = _logisticsCompany.CreateWaybill();  
        }
    }
}
